﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace ERP.MasterData.Dtos
{
    public class MaterialClassDto
    {
        public int Id { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        [Required(ErrorMessage = "分类名称不能为空")]
        public string ClassifyName { get; set; }

        /// <summary>
        /// 排序ID
        /// </summary>
        public int? OrderById { get; set; }

        /// <summary>
        /// 物料/产品类型
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 父级ID
        /// </summary>
        public int? ParentId { get; set; }

        /// <summary>
        /// 子节点
        /// </summary>
        public List<MaterialClassDto> Children { get; set; }
    }

    public class CreateMaterialClassDto
    {
        /// <summary>
        /// 父级分类
        /// </summary>
        public int? ParentId { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        [Required(ErrorMessage = "分类名称不能为空")]
        public string ClassifyName { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int? OrderById { get; set; }

        /// <summary>
        /// 物料/产品类型
        /// </summary>
        [Required(ErrorMessage = "请选择物料/产品类型")]
        public string MaterialName { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }
    }

    public class UpdateMaterialClassDto : CreateMaterialClassDto
    {
        public int Id { get; set; }
    }
}
